package com.bdqn.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 权限
 *
 * @TableName sys_right
 */
@Data
@TableName("sys_right")
public class Right implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 
     */
    @TableId
    private String rightCode;

    /**
     * 
     */
    private String rightParentCode;

    /**
     * 
     */
    private String rightType;

    /**
     * 
     */
    private String rightText;

    /**
     * 
     */
    private String rightUrl;

    /**
     * 
     */
    private String rightTip;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Right other = (Right) that;
        return (this.getRightCode() == null ? other.getRightCode() == null : this.getRightCode().equals(other.getRightCode()))
            && (this.getRightParentCode() == null ? other.getRightParentCode() == null : this.getRightParentCode().equals(other.getRightParentCode()))
            && (this.getRightType() == null ? other.getRightType() == null : this.getRightType().equals(other.getRightType()))
            && (this.getRightText() == null ? other.getRightText() == null : this.getRightText().equals(other.getRightText()))
            && (this.getRightUrl() == null ? other.getRightUrl() == null : this.getRightUrl().equals(other.getRightUrl()))
            && (this.getRightTip() == null ? other.getRightTip() == null : this.getRightTip().equals(other.getRightTip()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRightCode() == null) ? 0 : getRightCode().hashCode());
        result = prime * result + ((getRightParentCode() == null) ? 0 : getRightParentCode().hashCode());
        result = prime * result + ((getRightType() == null) ? 0 : getRightType().hashCode());
        result = prime * result + ((getRightText() == null) ? 0 : getRightText().hashCode());
        result = prime * result + ((getRightUrl() == null) ? 0 : getRightUrl().hashCode());
        result = prime * result + ((getRightTip() == null) ? 0 : getRightTip().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", rightCode=").append(rightCode);
        sb.append(", rightParentCode=").append(rightParentCode);
        sb.append(", rightType=").append(rightType);
        sb.append(", rightText=").append(rightText);
        sb.append(", rightUrl=").append(rightUrl);
        sb.append(", rightTip=").append(rightTip);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}